export default {
    formTest: {
        deliver: {
            baseInput: "",
            password: "",
            textarea: "",
            select: "",
            select_group: "",
            cascader: "",
            datePicker_date: "",
            datePicker_dates: "",
            datePicker_option: "",
            datePicker_week: "",
            datePicker_daterange: "",
            inputNumber: null,
        },
        rules: {
            baseInput: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "blur", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            password: [
                {
                    required: true, // 是否必填
                    message: "密码不能为空！", // 未必填提示的异常信息
                    trigger: "blur", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            textarea: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "blur", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
                { min: 5, max: 200, message: '输入内容在10~200个字符之间！', trigger: 'blur' },
                // 自定义规则校验
                {
                    validator: (rule, value, callback) => {
                        let reg = new RegExp("[`~@#$^&*()=|{}\\[\\].<>《》/?~@#￥……&*（）——|{}【】]")
                        if (reg.test(value)) {
                            callback(new Error('内容不得包含特殊字符！'));
                        } else {
                            callback();
                        }
                    },
                    trigger: "change",
                }
            ],

            select: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            select_group: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            cascader: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            datePicker_date: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            datePicker_dates: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            datePicker_option: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            datePicker_week: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            datePicker_daterange: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
            ],

            inputNumber: [
                {
                    required: true, // 是否必填
                    message: "必填项不能为空！", // 未必填提示的异常信息
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                },
                {
                    type: 'number',
                    message: '必须为数字值！',
                    trigger: "change", // 校验时机 blur-输入项失去焦点时；change-输入项内容变更时；
                }
            ]
        },
        proto: [
            {
                type: "text",
                label: "基础输入",
                value: "baseInput",
                maxlength: 100,
                placeholder: "请输入",
                prefix_icon: "",
                suffix_icon: "",
                prepend_icon: "el-icon-s-custom",
                prepend_style: {
                    "--background_color": "#e1f0ff",
                    "--color": "#007dff",
                },

                clearable: true,
                show_password: false,
                show_word_limit: false,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "text",
                label: "密码输入",
                value: "password",
                maxlength: 100,
                placeholder: "请输入密码",
                prefix_icon: "",
                suffix_icon: "",
                prepend_icon: "el-icon-key",
                prepend_style: {
                    "--background_color": "#e1f0ff",
                    "--color": "#007dff",
                },

                clearable: true,
                show_password: true,
                show_word_limit: false,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "textarea",
                label: "输入域",
                value: "textarea",
                minlength: 5,
                maxlength: 200,
                placeholder: "请输入",

                autosize: {
                    minRows: 2,
                    maxRows: 6,
                },

                clearable: true,
                show_word_limit: true,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "select",
                label: "选择器",
                value: "select",
                placeholder: "请选择",
                multiple_limit: 0, // 多选时限制选择的数量，0为不限制

                clearable: true,
                multiple: false,     // 是否可以多选
                collapse_tags: false,// 多选时是否显示所有选项的中文标签
                disabled: false,
                validate_event: true,
                size: "medium",

                options: [{
                    label: "测试1",
                    value: "测试1-value",
                }, {
                    label: "测试2",
                    value: "测试2-value",
                }, {
                    label: "测试3",
                    value: "测试3-value",
                }]
            },
            {
                type: "select_group",
                label: "组选择器",
                value: "select_group",
                placeholder: "请选择",
                multiple_limit: 0, // 多选时限制选择的数量，0为不限制

                clearable: true,
                multiple: false,     // 是否可以多选
                collapse_tags: false,// 多选时是否显示所有选项的中文标签
                disabled: false,
                validate_event: true,
                size: "medium",

                options: [{
                    label: "测试组1",
                    options: [
                        {
                            label: "测试1-1",
                            value: "测试1-1-value",
                        }, {
                            label: "测试1-2",
                            value: "测试1-2-value",
                        }, {
                            label: "测试1-3",
                            value: "测试1-3-value",
                        }
                    ]
                }, {
                    label: "测试组2",
                    options: [
                        {
                            label: "测试2-1",
                            value: "测试2-1-value",
                        }, {
                            label: "测试2-2",
                            value: "测试2-2-value",
                        }, {
                            label: "测试2-3",
                            value: "测试2-3-value",
                        }
                    ]
                }]
            },
            {
                type: "cascader",
                label: "级联选择",
                value: "cascader",
                placeholder: "请选择",

                clearable: true,
                disabled: false,
                validate_event: true,
                show_all_levels: true,
                separator: ";",
                size: "medium",
                options: [{
                    value: 'zhinan',
                    label: '指南',
                    children: [{
                        value: 'shejiyuanze',
                        label: '设计原则',
                        children: [{
                            value: 'yizhi',
                            label: '一致'
                        }, {
                            value: 'fankui',
                            label: '反馈'
                        }, {
                            value: 'xiaolv',
                            label: '效率'
                        }, {
                            value: 'kekong',
                            label: '可控'
                        }]
                    }, {
                        value: 'daohang',
                        label: '导航',
                        children: [{
                            value: 'cexiangdaohang',
                            label: '侧向导航'
                        }, {
                            value: 'dingbudaohang',
                            label: '顶部导航'
                        }]
                    }]
                }, {
                    value: 'zujian',
                    label: '组件',
                    children: [{
                        value: 'basic',
                        label: 'Basic',
                        children: [{
                            value: 'layout',
                            label: 'Layout 布局'
                        }, {
                            value: 'color',
                            label: 'Color 色彩'
                        }, {
                            value: 'typography',
                            label: 'Typography 字体'
                        }, {
                            value: 'icon',
                            label: 'Icon 图标'
                        }, {
                            value: 'button',
                            label: 'Button 按钮'
                        }]
                    }, {
                        value: 'form',
                        label: 'Form',
                        children: [{
                            value: 'radio',
                            label: 'Radio 单选框'
                        }, {
                            value: 'checkbox',
                            label: 'Checkbox 多选框'
                        }, {
                            value: 'input',
                            label: 'Input 输入框'
                        }, {
                            value: 'input-number',
                            label: 'InputNumber 计数器'
                        }, {
                            value: 'select',
                            label: 'Select 选择器'
                        }, {
                            value: 'cascader',
                            label: 'Cascader 级联选择器'
                        }, {
                            value: 'switch',
                            label: 'Switch 开关'
                        }, {
                            value: 'slider',
                            label: 'Slider 滑块'
                        }, {
                            value: 'time-picker',
                            label: 'TimePicker 时间选择器'
                        }, {
                            value: 'date-picker',
                            label: 'DatePicker 日期选择器'
                        }, {
                            value: 'datetime-picker',
                            label: 'DateTimePicker 日期时间选择器'
                        }, {
                            value: 'upload',
                            label: 'Upload 上传'
                        }, {
                            value: 'rate',
                            label: 'Rate 评分'
                        }, {
                            value: 'form',
                            label: 'Form 表单'
                        }]
                    }, {
                        value: 'data',
                        label: 'Data',
                        children: [{
                            value: 'table',
                            label: 'Table 表格'
                        }, {
                            value: 'tag',
                            label: 'Tag 标签'
                        }, {
                            value: 'progress',
                            label: 'Progress 进度条'
                        }, {
                            value: 'tree',
                            label: 'Tree 树形控件'
                        }, {
                            value: 'pagination',
                            label: 'Pagination 分页'
                        }, {
                            value: 'badge',
                            label: 'Badge 标记'
                        }]
                    }, {
                        value: 'notice',
                        label: 'Notice',
                        children: [{
                            value: 'alert',
                            label: 'Alert 警告'
                        }, {
                            value: 'loading',
                            label: 'Loading 加载'
                        }, {
                            value: 'message',
                            label: 'Message 消息提示'
                        }, {
                            value: 'message-box',
                            label: 'MessageBox 弹框'
                        }, {
                            value: 'notification',
                            label: 'Notification 通知'
                        }]
                    }, {
                        value: 'navigation',
                        label: 'Navigation',
                        children: [{
                            value: 'menu',
                            label: 'NavMenu 导航菜单'
                        }, {
                            value: 'tabs',
                            label: 'Tabs 标签页'
                        }, {
                            value: 'breadcrumb',
                            label: 'Breadcrumb 面包屑'
                        }, {
                            value: 'dropdown',
                            label: 'Dropdown 下拉菜单'
                        }, {
                            value: 'steps',
                            label: 'Steps 步骤条'
                        }]
                    }, {
                        value: 'others',
                        label: 'Others',
                        children: [{
                            value: 'dialog',
                            label: 'Dialog 对话框'
                        }, {
                            value: 'tooltip',
                            label: 'Tooltip 文字提示'
                        }, {
                            value: 'popover',
                            label: 'Popover 弹出框'
                        }, {
                            value: 'card',
                            label: 'Card 卡片'
                        }, {
                            value: 'carousel',
                            label: 'Carousel 走马灯'
                        }, {
                            value: 'collapse',
                            label: 'Collapse 折叠面板'
                        }]
                    }]
                }, {
                    value: 'ziyuan',
                    label: '资源',
                    children: [{
                        value: 'axure',
                        label: 'Axure Components'
                    }, {
                        value: 'sketch',
                        label: 'Sketch Templates'
                    }, {
                        value: 'jiaohu',
                        label: '组件交互文档'
                    }]
                }],
            },
            {
                type: "datePicker",
                subType: "date", // year/month/date/dates/week/datetime/datetimerange/daterange/monthrange
                label: "常规日期",
                value: "datePicker_date",
                placeholder: "请选择",
                pickerOptions: {},
                prefix_icon: "el-icon-date",
                clear_icon: "el-icon-circle-close",

                format: "yyyy-MM-dd",
                value_format: "yyyy-MM-dd", // yyyy-MM-dd \ timestamp
                align: "left",

                start_placeholder: "",
                end_placeholder: "",
                range_separator: "-",
                unlink_panels: false,

                clearable: true,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "datePicker",
                subType: "date", // year/month/date/dates/week/datetime/datetimerange/daterange/monthrange
                label: "快捷日期",
                value: "datePicker_option",
                placeholder: "请选择",
                prefix_icon: "el-icon-date",
                clear_icon: "el-icon-circle-close",
                pickerOptions: {
                    disabledDate(time) {
                        return time.getTime() > Date.now();
                    },
                    shortcuts: [{
                        text: '今天',
                        onClick(picker) {
                            picker.$emit('pick', new Date());
                        }
                    }, {
                        text: '昨天',
                        onClick(picker) {
                            const date = new Date();
                            date.setTime(date.getTime() - 3600 * 1000 * 24);
                            picker.$emit('pick', date);
                        }
                    }, {
                        text: '一周前',
                        onClick(picker) {
                            const date = new Date();
                            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', date);
                        }
                    }]
                },

                format: "yyyy-MM-dd",
                value_format: "yyyy-MM-dd", // yyyy-MM-dd \ timestamp
                align: "left",

                start_placeholder: "",
                end_placeholder: "",
                range_separator: "-",
                unlink_panels: false,

                clearable: true,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "datePicker",
                subType: "week", // year/month/date/dates/week/datetime/datetimerange/daterange/monthrange
                label: "周选择",
                value: "datePicker_week",
                placeholder: "请选择",
                pickerOptions: {},
                prefix_icon: "el-icon-date",
                clear_icon: "el-icon-circle-close",

                format: "yyyy 第 WW 周",
                value_format: "yyyy-MM-dd",
                align: "left",

                start_placeholder: "",
                end_placeholder: "",
                range_separator: "-",
                unlink_panels: false,

                clearable: true,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "datePicker",
                subType: "dates", // year/month/date/dates/week/datetime/datetimerange/daterange/monthrange
                label: "日期多选",
                value: "datePicker_dates",
                placeholder: "请选择",
                pickerOptions: {},
                prefix_icon: "el-icon-date",
                clear_icon: "el-icon-circle-close",

                format: "yyyy-MM-dd",
                value_format: "yyyy-MM-dd", // yyyy-MM-dd \ timestamp
                align: "left",

                start_placeholder: "",
                end_placeholder: "",
                range_separator: "-",
                unlink_panels: false,

                clearable: true,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "datePicker",
                subType: "daterange", // year/month/date/dates/week/datetime/datetimerange/daterange/monthrange
                label: "日期区间",
                value: "datePicker_daterange",
                placeholder: "请选择",
                pickerOptions: {
                    shortcuts: [{
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }]
                },
                prefix_icon: "el-icon-date",
                clear_icon: "el-icon-circle-close",

                format: "yyyy-MM-dd",
                value_format: "yyyy-MM-dd", // yyyy-MM-dd \ timestamp
                align: "left",

                start_placeholder: "开始日期",
                end_placeholder: "结束日期",
                range_separator: "~",
                unlink_panels: true,

                clearable: true,
                disabled: false,
                readonly: false,
                validate_event: true,
                size: "medium",
            },
            {
                type: "inputNumber",
                label: "记步器",
                value: "inputNumber",
                placeholder: "请输入",
                min: 0,
                max: 100,
                step: 1,
                precision: 1,
                controls_position: "", // right \ ""

                clearable: true,
                disabled: false,
                readonly: false,
                controls: true,
                step_strictly: false,
                validate_event: true,
                size: "medium",
            },
        ],
        selfLine: {
            showSelfLine: true,
            selfLabel: '附件选择'
        }
    }
}